<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>品牌管理</title>
    <!-- 上传插件 -->
    <script type="text/javascript" src="http://localhost/jumei/Static/uploadify/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="http://localhost/jumei/Static/uploadify/jquery.uploadify.min.js"></script>
    <link href="http://localhost/jumei/Static/uploadify/uploadify.css" type="text/css" rel="stylesheet"></link>
    <!-- 上传插件 -->
    <link rel="stylesheet" href="http://localhost/jumei/Static/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="http://localhost/jumei/Static/hdjs/hdjs.css">
    <script type="text/javascript">
        $(function() {
            $('#file').uploadify({
                'formData'     : {//POST数据
                    '<?php echo session_name();?>' : '<?php echo session_id();?>',
                },
                'fileTypeDesc' : '上传文件',//上传描述
                'fileTypeExts' : '<?php echo $set['filetype'];?>',
                'swf'      : 'http://localhost/jumei/Static/uploadify/uploadify.swf',
                'uploader' : '<?php echo U("Brand/upload");?>',
                'buttonText':'选择文件',
                'fileSizeLimit' : '2000KB',
                'uploadLimit' : 1000,//上传文件数
                'width':65,
                'height':25,
                'successTimeout':10,//等待服务器响应时间
                'removeTimeout' : 0.2,//成功显示时间
                'onUploadSuccess' : function(file, data, response) {
                    data=$.parseJSON(data);
                    var imageUrl = data.image?data.url:'http://localhost/jumei/Static/image/default.png';
                    var li="<li path='"+data.path+"' url='"+data.url+"'><img src='"+imageUrl+"' class='hd-w80 hd-h70'/></li>";
                    $("#uploadList .logo").prepend(li);
                    var input = "<input type='hidden' name='logo' value='"+data.path+"'/>"
                    $('input[type=submit]').after(input);
                }
            });
        });
    </script>
</head>
<body>
<div class="wrap">
    <div class="hd-title-header">添加品牌</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="hd-table hd-table-list">
            <tr>
                <th class="w100" width="100">品牌名称</th>
                <td  class="w100">
                    <input type="text" name="bname" class="w200"/> 
                </td>
                <td></td>
            </tr>
            <!-- <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="pid" class="w200">
                        <option value="0">请选择类型</option>
                        <?php foreach ($topCate as $k=>$v){?>
                            <option value="<?php echo $v['cid'];?>"    <?php if($data['pid']==$v['cid']){ ?>selected="selected"<?php } ?>><?php echo $v['cname'];?></option>
                        <?php }?>
                    </select>
                </td>
                <td></td>
            </tr> -->
            <tr>
                <th class="w100">品牌排序</th>
                <td>
                    <input type="text" name="sort" class="w200" value="100"/>
                </td>
                <td>请填写1到65535的排序数字 </td>
            </tr>
            <tr>
                <th class="w100">品牌LOGO</th>
                <td>
                    <div lab="uploadFile">
                        <input id="file" type="file" multiple="true">
                        <!-- <span>类型: *.jpg,*.png 大小: 2000KB 数量: 10</span> -->
                        <div id="uploadList">
                            <ul class="logo">
             
                            </ul>
                        </div>
                    </div>
                </td>
                <style type="text/css">
                    #file{
                        float: left;
                        margin-right: 20px;
                    }
                    #file-queue{
                        float: left;
                    }
                    #uploadList ul li{
                        float:left;
                        margin-right: 10px;
                    }
                </style>
                <td> </td>
            </tr>
            <tr>
                <th class="w100">是否热门</th>
                <td>
                    是：<input type="radio" name="is_hot" id="" checked="checked" value="1"/>
                    &nbsp;
                    否: <input type="radio" name="is_hot" id=""  value="0"/>
                </td>
                <td></td>
            </tr>       
        </table>
        <div class="position-bottom">
            <input type="submit" class="btn btn-primary" value="添加" style="margin-left:70px;margin-top:15px" />
        </div>
    </form>
</div>
</body>
</html>